<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" >

	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
	<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css?family=Cousine|Inconsolata" rel="stylesheet">
	<link rel="shortcut icon" type="image/png" href="/favicon.png">

	
	<link rel="stylesheet" href="/css/style.css">
	<link rel="stylesheet" href="/css/css/fontawesome-all.min.css">
	<script src="/js/main.js"></script>
	

	<!-- Begin Jekyll SEO tag v2.1.0 -->
<title>JS: Get Post Details - Steem Developer</title>
<meta property="og:title" content="JS: Get Post Details" />
<meta name="description" content="By the end of this tutorial you would know how to get post details and use them appropriately" />
<meta property="og:description" content="By the end of this tutorial you would know how to get post details and use them appropriately" />
<link rel="canonical" href="https://developer.steem.io/tutorials-javascript/get_post_details" />
<meta property="og:url" content="https://developer.steem.io/tutorials-javascript/get_post_details" />
<meta property="og:site_name" content="Steem Developer" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2018-07-20T12:56:08-05:00" />
<script type="application/ld+json">
{"@context": "http://schema.org",
"@type": "BlogPosting",
"headline": "JS: Get Post Details",
"datePublished": "2018-07-20T12:56:08-05:00",
"description": "By the end of this tutorial you would know how to get post details and use them appropriately",
"url": "https://developer.steem.io/tutorials-javascript/get_post_details"}</script>
<!-- End Jekyll SEO tag -->


	
</head>
<body>
<header>
	<h1>
		<button type="button" class="open-nav" id="open-nav"></button>
		<a href="/"  class="logo-link"><img src="/images/logotype_white.svg" height="40" alt="Steem Developer logo"></a>
	</h1>

	
	<form action="/search/" method="get">
		<input type="text" name="q" id="search-input" placeholder="Search">
		<input type="submit" value="Search" style="display: none;">
	</form>
	

	<div id="sidebar" class="sidebar">
	
	
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/">
		<h6 class="ctrl-nav-section title">Introduction</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/#introduction-welcome">Welcome to Steem</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/quickstart/">
		<h6 class="ctrl-nav-section title">Quickstart</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/quickstart/#quickstart-choose-library">Choose Library</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-steemd-nodes">steemd Nodes</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-testnet">Steem Testnet</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/tutorials/">
		<h6 class="ctrl-nav-section title">Tutorials</h6>
		<ul class="cont-nav-section content">
			
				
					
						<li><a href="/tutorials/#tutorials-javascript">Javascript</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-python">Python</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-ruby">Ruby</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-recipes">Recipes</a></li>
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/services/">
		<h6 class="ctrl-nav-section title">Services</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/services/#services-steemit">Steemit.com</a></li>
						
					
						
						<li><a href="/services/#services-steemconnect">SteemConnect</a></li>
						
					
						
						<li><a href="/services/#services-jussi">jussi</a></li>
						
					
						
						<li><a href="/services/#services-imagehoster">ImageHoster</a></li>
						
					
						
						<li><a href="/services/#services-sbds">SBDS</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/apidefinitions/">
		<h6 class="ctrl-nav-section title">Appbase API</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/apidefinitions/#apidefinitions-condenser-api">Condenser Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-by-key-api">Account By Key Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops-comment">Broadcast Ops Comment</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-history-api">Account History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-database-api">Database Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-follow-api">Follow Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-jsonrpc">Jsonrpc</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-market-history-api">Market History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-network-broadcast-api">Network Broadcast Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-tags-api">Tags Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-witness-api">Witness Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-block-api">Block Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops">Broadcast Ops</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/community/">
		<h6 class="ctrl-nav-section title">Community</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/community/#community-overview">Overview</a></li>
						
					
						
						<li><a href="/community/#community-resources">Resources</a></li>
						
					
						
						<li><a href="/community/#community-developeradvocate">Sharing & Help</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/glossary/">
		<h6 class="ctrl-nav-section title">Glossary</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/glossary/#glossary-chain-basics">Chain Basics</a></li>
						
					
						
					
						
						<li><a href="/glossary/#glossary-governance">Governance</a></li>
						
					
						
						<li><a href="/glossary/#glossary-transactions">Transactions</a></li>
						
					
						
						<li><a href="/glossary/#glossary-api">API</a></li>
						
					
						
						<li><a href="/glossary/#glossary-market">Market</a></li>
						
					
				
			
		</ul>
	</section>
	
</div>


	<!--<p class="copyright">-->
	<!--<a href="https://steemit.com.com/">-->
	<!--steemit-->
	<!--</a>-->
	<!--</p>-->
	<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
</header>
<div class="main" id="top">
	<div class="hero">
		<h1 class="hero__h1">Steem Developer Portal </h1>
		
		<img class="hero__img" src="/images/hero.png">
		
	</div>
	<section id="tutorials-javascript-get-post-details" class="row tutorials-javascript-get-post-details">
	<h3>
		<a id="tutorials-javascript-get-post-details">
			JS: Get Post Details
			
		</a>
	</h3>
	
		<p class="description">By the end of this tutorial you would know how to get post details and use them appropriately</p>
	

	<p><span class="fa-pull-left top-of-tutorial-repo-link"><span class="first-word">Full</span>, runnable src of <a href="https://github.com/steemit/devportal-tutorials-js/tree/master/tutorials/05_get_post_details">Get Post Details</a> can be downloaded as part of the <a href="https://github.com/steemit/devportal-tutorials-js">JS tutorials repository</a>.</span>
<br /></p>

<p>The purpose of this tutorial is to <strong>a)</strong> demonstrate how to get a list of articles from the trending list on the blockchain, and <strong>b)</strong> fetch the contents of the selected post to display its title and body.</p>

<p>We will also explain the most commonly used fields from the response object as well as parse body of the post.</p>

<h2 id="intro">Intro</h2>

<p>Accounts have unique <code class="highlighter-rouge">permlink</code> - permanent link for each of their posts. And Steem blockchain provides API to directly fetch current state of the post and its details. We will be using <code class="highlighter-rouge">get_content</code> to retrieve additional details. We can easily reformat data in a way that fits out application.</p>

<h2 id="steps">Steps</h2>

<ol>
  <li><a href="#fetch-posts"><strong>Fetching posts</strong></a> Trending posts list</li>
  <li><a href="#post-content"><strong>Post content</strong></a> Extract content of the selected post</li>
  <li><a href="#query-result"><strong>Query result</strong></a> Returned data</li>
</ol>

<h4 id="1-fetching-posts">1. Fetching posts<a name="fetch-posts"></a></h4>

<p>As mentioned in our previous tutorial we can fetch various lists of posts with different filters. Here, we are reusing some parts of that tutorial to list the top 5 trending posts.</p>

<div class="language-javascript highlighter-rouge"><pre class="highlight"><code><span class="kd">var</span> <span class="nx">query</span> <span class="o">=</span> <span class="p">{</span>
    <span class="na">tag</span><span class="p">:</span> <span class="s1">''</span><span class="p">,</span> <span class="c1">// This tag is used to filter the results by a specific post tag.</span>
    <span class="na">limit</span><span class="p">:</span> <span class="mi">5</span><span class="p">,</span> <span class="c1">// This allows us to limit the total to 5 items.</span>
    <span class="na">truncate_body</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="c1">// This will truncate the body of each post to 1 character, which is useful if you want to work with lighter array.</span>
<span class="p">};</span>
</code></pre>
</div>

<h4 id="2-post-content">2. Post content<a name="post-content"></a></h4>

<p>On selection of a particular post from the list, <code class="highlighter-rouge">openPost</code> function is fired. This function will call the <code class="highlighter-rouge">get_content</code> function to fetch content of the post. <code class="highlighter-rouge">get_content</code> requires author and permlink of the post to fetch its data.</p>

<div class="language-javascript highlighter-rouge"><pre class="highlight"><code><span class="nx">client</span><span class="p">.</span><span class="nx">database</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="s1">'get_content'</span><span class="p">,</span> <span class="p">[</span><span class="nx">author</span><span class="p">,</span> <span class="nx">permlink</span><span class="p">]).</span><span class="nx">then</span><span class="p">(</span><span class="nx">result</span> <span class="o">=&gt;</span> <span class="p">{</span>
    <span class="kr">const</span> <span class="nx">md</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Remarkable</span><span class="p">({</span> <span class="na">html</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="na">linkify</span><span class="p">:</span> <span class="kc">true</span> <span class="p">});</span>

    <span class="kr">const</span> <span class="nx">body</span> <span class="o">=</span> <span class="nx">md</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="nx">result</span><span class="p">.</span><span class="nx">body</span><span class="p">);</span>

    <span class="kr">const</span> <span class="nx">content</span> <span class="o">=</span> <span class="err">`</span><span class="o">&lt;</span><span class="nx">div</span> <span class="kr">class</span><span class="o">=</span><span class="s1">'pull-right'</span><span class="o">&gt;&lt;</span><span class="nx">button</span> <span class="nx">onclick</span><span class="o">=</span><span class="nx">goback</span><span class="p">()</span><span class="o">&gt;</span><span class="nx">Close</span><span class="o">&lt;</span><span class="sr">/button&gt;&lt;/</span><span class="nx">div</span><span class="o">&gt;&lt;</span><span class="nx">br</span><span class="o">&gt;&lt;</span><span class="nx">h2</span><span class="o">&gt;</span><span class="nx">$</span><span class="p">{</span>
        <span class="nx">result</span><span class="p">.</span><span class="nx">title</span>
    <span class="p">}</span><span class="o">&lt;</span><span class="sr">/h2&gt;&lt;br&gt;${body}&lt;br&gt;`</span><span class="err">;
</span>
    <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'postList'</span><span class="p">).</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">'none'</span><span class="p">;</span>
    <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'postBody'</span><span class="p">).</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">'block'</span><span class="p">;</span>
    <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'postBody'</span><span class="p">).</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">content</span><span class="p">;</span>
<span class="p">});</span>
</code></pre>
</div>

<p>Steem allows any text-based format for the body, but apps often follow standard markdown with mix of few html tags. After we have fetched the content, we can use the <code class="highlighter-rouge">remarkable</code> library to parse the body of the post into a readable format. The title and body of the post are then displayed with a button at the top right corner to switch back to the post list.</p>

<div class="language-javascript highlighter-rouge"><pre class="highlight"><code><span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'postList'</span><span class="p">).</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">'block'</span><span class="p">;</span>
<span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'postBody'</span><span class="p">).</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">'none'</span><span class="p">;</span>
</code></pre>
</div>

<p>The “go back” function simply hides and shows the post list.</p>

<h4 id="3-query-result">3. Query result<a name="query-result"></a></h4>

<p>The result is returned from the post content as a <code class="highlighter-rouge">JSON</code> object with the following properties:</p>

<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
    </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">37338948</span><span class="p">,</span><span class="w">
    </span><span class="nt">"author"</span><span class="p">:</span><span class="w"> </span><span class="s2">"steemitblog"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"permlink"</span><span class="p">:</span><span class="w"> </span><span class="s2">"join-team-steemit-at-tokenfest"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"category"</span><span class="p">:</span><span class="w"> </span><span class="s2">"steemit"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"parent_author"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
    </span><span class="nt">"parent_permlink"</span><span class="p">:</span><span class="w"> </span><span class="s2">"steemit"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Join Team Steemit at TokenFest!"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"body"</span><span class="p">:</span><span class="w">
        </span><span class="s2">"&lt;a href=\"https://tokenfest.adria.digital\"&gt;&lt;img src=\"https://i.imgur.com/fOScDIW.png\"/&gt;&lt;/a&gt;\n\nHello Steemians! If you’d like to meet Team Steemit live-in-person, or are just interested in attending what promises to be a great blockchain conference, join us at &lt;a href=\"https://tokenfest.adria.digital/\"&gt;TokenFest&lt;/a&gt; in San Francisco from March 15th to 16th. \n\nSteemit CEO, Ned Scott, will be participating in a fireside chat alongside Steemit’s CTO, Harry Schmidt, as well as the creator of Utopian.io, Diego Pucci. Steemit will also be hosting the opening party on Thursday night and we’d certainly love to meet as many of you as possible IRL, so head on over to https://tokenfest.adria.digital/ and get your tickets while you can. \n\n*Team Steemit*"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"json_metadata"</span><span class="p">:</span><span class="w">
        </span><span class="s2">"{\"tags\":[\"steemit\",\"tokenfest\",\"conference\"],\"image\":[\"https://i.imgur.com/fOScDIW.png\"],\"links\":[\"https://tokenfest.adria.digital\",\"https://tokenfest.adria.digital/\"],\"app\":\"steemit/0.1\",\"format\":\"markdown\"}"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"last_update"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-03-07T23:22:54"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"created"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-03-07T20:56:36"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"active"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-03-13T01:40:21"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"last_payout"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1970-01-01T00:00:00"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"depth"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
    </span><span class="nt">"children"</span><span class="p">:</span><span class="w"> </span><span class="mi">29</span><span class="p">,</span><span class="w">
    </span><span class="nt">"net_rshares"</span><span class="p">:</span><span class="w"> </span><span class="s2">"11453442114933"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"abs_rshares"</span><span class="p">:</span><span class="w"> </span><span class="s2">"11454054795840"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"vote_rshares"</span><span class="p">:</span><span class="w"> </span><span class="s2">"11454054795840"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"children_abs_rshares"</span><span class="p">:</span><span class="w"> </span><span class="s2">"13568695606090"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"cashout_time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-03-14T20:56:36"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"max_cashout_time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1969-12-31T23:59:59"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"total_vote_weight"</span><span class="p">:</span><span class="w"> </span><span class="mi">3462435</span><span class="p">,</span><span class="w">
    </span><span class="nt">"reward_weight"</span><span class="p">:</span><span class="w"> </span><span class="mi">10000</span><span class="p">,</span><span class="w">
    </span><span class="nt">"total_payout_value"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.000 SBD"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"curator_payout_value"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.000 SBD"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"author_rewards"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
    </span><span class="nt">"net_votes"</span><span class="p">:</span><span class="w"> </span><span class="mi">77</span><span class="p">,</span><span class="w">
    </span><span class="nt">"root_comment"</span><span class="p">:</span><span class="w"> </span><span class="mi">37338948</span><span class="p">,</span><span class="w">
    </span><span class="nt">"max_accepted_payout"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.000 SBD"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"percent_steem_dollars"</span><span class="p">:</span><span class="w"> </span><span class="mi">10000</span><span class="p">,</span><span class="w">
    </span><span class="nt">"allow_replies"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
    </span><span class="nt">"allow_votes"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
    </span><span class="nt">"allow_curation_rewards"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
    </span><span class="nt">"beneficiaries"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
    </span><span class="nt">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/steemit/@steemitblog/join-team-steemit-at-tokenfest"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"root_title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Join Team Steemit at TokenFest!"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"pending_payout_value"</span><span class="p">:</span><span class="w"> </span><span class="s2">"46.436 SBD"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"total_pending_payout_value"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.000 STEEM"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"active_votes"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
        </span><span class="p">{</span><span class="w">
            </span><span class="nt">"voter"</span><span class="p">:</span><span class="w"> </span><span class="s2">"steemitblog"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"weight"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
            </span><span class="nt">"rshares"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1870813909383"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"percent"</span><span class="p">:</span><span class="w"> </span><span class="mi">10000</span><span class="p">,</span><span class="w">
            </span><span class="nt">"reputation"</span><span class="p">:</span><span class="w"> </span><span class="s2">"128210130644387"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-03-07T20:56:36"</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="p">{</span><span class="w">
            </span><span class="nt">"voter"</span><span class="p">:</span><span class="w"> </span><span class="s2">"kevinwong"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"weight"</span><span class="p">:</span><span class="w"> </span><span class="mi">526653</span><span class="p">,</span><span class="w">
            </span><span class="nt">"rshares"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2208942520687"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"percent"</span><span class="p">:</span><span class="w"> </span><span class="mi">5000</span><span class="p">,</span><span class="w">
            </span><span class="nt">"reputation"</span><span class="p">:</span><span class="w"> </span><span class="s2">"374133832002581"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-03-08T04:27:00"</span><span class="w">
        </span><span class="p">}</span><span class="w">
    </span><span class="p">],</span><span class="w">
    </span><span class="nt">"replies"</span><span class="p">:</span><span class="w"> </span><span class="p">[],</span><span class="w">
    </span><span class="nt">"author_reputation"</span><span class="p">:</span><span class="w"> </span><span class="s2">"128210130644387"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"promoted"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.000 SBD"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"body_length"</span><span class="p">:</span><span class="w"> </span><span class="mi">754</span><span class="p">,</span><span class="w">
    </span><span class="nt">"reblogged_by"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
</div>

<p>From this result, you have access to everything associated with the selected post, including additional metadata which is a <code class="highlighter-rouge">JSON</code> string that must be decoded to use.</p>

<ul>
  <li><code class="highlighter-rouge">id</code> - Unique identifier that is mostly an implementation detail (best to ignore). To uniquely identify content, it’s best to use <code class="highlighter-rouge">author/permlink</code>.</li>
  <li><code class="highlighter-rouge">author</code> - The author account name of the content.</li>
  <li><code class="highlighter-rouge">permlink</code> - Permanent link of the content, must be unique in the scope of the <code class="highlighter-rouge">author</code>.</li>
  <li><code class="highlighter-rouge">category</code> - The main category/tag this content belongs to.</li>
  <li><code class="highlighter-rouge">parent_author</code> - Parent author, in case this content is a comment (reply).</li>
  <li><code class="highlighter-rouge">parent_permlink</code> - Parent permanent link, this will be the same as <code class="highlighter-rouge">category</code> for posts and will contain the <code class="highlighter-rouge">permlink</code> of the content being replied to in the case of a comment.</li>
  <li><code class="highlighter-rouge">title</code> - Title of the content.</li>
  <li><code class="highlighter-rouge">body</code> - Body of the content.</li>
  <li><code class="highlighter-rouge">json_metadata</code> - JSON metadata that holds extra information about the content. <strong>Note:</strong> The format for this field is not guaranteed to be valid JSON.</li>
  <li><code class="highlighter-rouge">last_update</code> - The date and time of the last update to this content.</li>
  <li><code class="highlighter-rouge">created</code> - The date and time this content was created.</li>
  <li><code class="highlighter-rouge">active</code> - The last time this content was “touched” by voting or reply.</li>
  <li><code class="highlighter-rouge">last_payout</code> - Time of last payout.</li>
  <li><code class="highlighter-rouge">depth</code> - Used to track max nested depth.</li>
  <li><code class="highlighter-rouge">children</code> - Used to track the total number of children, grandchildren, etc. …</li>
  <li><code class="highlighter-rouge">net_rshares</code> - Reward is proportional to liniar rshares, this is the sum of all votes (positive and negative reward sum)</li>
  <li><code class="highlighter-rouge">abs_rshares</code> - This was used to track the total absolute weight of votes for the purpose of calculating <code class="highlighter-rouge">cashout_time</code>.</li>
  <li><code class="highlighter-rouge">vote_rshares</code> - Total positive rshares from all votes. Used to calculate delta weights. Needed to handle vote changing and removal.</li>
  <li><code class="highlighter-rouge">children_abs_rshares</code> - This was used to calculate cashout time of a discussion.</li>
  <li><code class="highlighter-rouge">cashout_time</code> - 7 days from the <code class="highlighter-rouge">created</code> date.</li>
  <li><code class="highlighter-rouge">max_cashout_time</code> - Unused.</li>
  <li><code class="highlighter-rouge">total_vote_weight</code> - The total weight of voting rewards, used to calculate pro-rata share of curation payouts.</li>
  <li><code class="highlighter-rouge">reward_weight</code> - Weight/percent of reward.</li>
  <li><code class="highlighter-rouge">total_payout_value</code> - Tracks the total payout this content has received over time, measured in the debt asset.</li>
  <li><code class="highlighter-rouge">curator_payout_value</code> - Tracks the curator payout this content has received over time, measured in the debt asset.</li>
  <li><code class="highlighter-rouge">author_rewards</code> - Tracks the author payout this content has received over time, measured in the debt asset.</li>
  <li><code class="highlighter-rouge">net_votes</code> - Net positive votes</li>
  <li><code class="highlighter-rouge">root_comment</code> - ID of the original content.</li>
  <li><code class="highlighter-rouge">max_accepted_payout</code> - Value of the maximum payout this content will receive.</li>
  <li><code class="highlighter-rouge">percent_steem_dollars</code> - The percent of Steem Dollars to key, unkept amounts will be received as STEEM Power.</li>
  <li><code class="highlighter-rouge">allow_replies</code> - Allows content to disable replies.</li>
  <li><code class="highlighter-rouge">allow_votes</code> - Allows content to receive votes.</li>
  <li><code class="highlighter-rouge">allow_curation_rewards</code> - Allows curators of this content receive rewards.</li>
  <li><code class="highlighter-rouge">beneficiaries</code> - The list of up to 8 beneficiary accounts for this content as well as the percentage of the author reward they will receive in STEEM Power.</li>
  <li><code class="highlighter-rouge">url</code> - The end of the url to this content.</li>
  <li><code class="highlighter-rouge">root_title</code> - Title of the original content (useful in replies).</li>
  <li><code class="highlighter-rouge">pending_payout_value</code> - Pending payout amount if 7 days has not yet elapsed.</li>
  <li><code class="highlighter-rouge">total_pending_payout_value</code> - Total pending payout amount if 7 days has not yet elapsed.</li>
  <li><code class="highlighter-rouge">active_votes</code> - The entire voting list array, including upvotes, downvotes, and unvotes; used to calculate <code class="highlighter-rouge">net_votes</code>.</li>
  <li><code class="highlighter-rouge">replies</code> - Unused.</li>
  <li><code class="highlighter-rouge">author_reputation</code> - Author’s reputation.</li>
  <li><code class="highlighter-rouge">promoted</code> - If post is promoted, how much has been spent on promotion.</li>
  <li><code class="highlighter-rouge">body_length</code> - Total content length.</li>
  <li><code class="highlighter-rouge">reblogged_by</code> - Unused.</li>
</ul>

<p>That’s it!</p>

<h3 id="to-run-the-tutorial">To Run the tutorial</h3>

<ol>
  <li>clone this repo</li>
  <li><code class="highlighter-rouge">cd tutorials/05_get_post_details</code></li>
  <li><code class="highlighter-rouge">npm i</code></li>
  <li><code class="highlighter-rouge">npm run dev-server</code> or <code class="highlighter-rouge">npm run start</code></li>
  <li>After a few moments, the server should be running at <a href="http://localhost:3000/">http://localhost:3000/</a></li>
</ol>

<hr />

</section>

</div>
<div class="footer">
	<a href="#">Back to top</a>
</div>
<script>
    document.getElementById("open-nav").addEventListener("click", function () {
        document.body.classList.toggle("nav-open");
    });
</script>
</body>
</html>


<script src="/js/adjust.js"></script>

